package com.keix.study.redis;

import java.time.Duration;

import io.lettuce.core.RedisClient;
import io.lettuce.core.RedisURI;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.sync.RedisStringCommands;

/** 
* @author liyongkang
* @version 创建时间：2019年2月25日 下午2:13:10 
* 类说明 ：
*/

public class RedisTest {

	public static void main(String[] args) {
		RedisURI uri = RedisURI.create("192.168.119.137", 6379);
		RedisClient client = RedisClient.create(uri);
		StatefulRedisConnection<String, String> connection = client.connect();
		RedisStringCommands<String, String> sync = connection.sync();
		String result = sync.set("name", "liyongkang");
		String name = sync.get("name");
		System.out.println(name);
	}

}
